﻿namespace OpenPms.Areas.M.Pages.Setup.RoomType;

public class IndexModel : PageModel
{
    private readonly Data.AppDbContext _context;

    public IndexModel(Data.AppDbContext context)
    {
        _context = context;
    }

    public IList<TRoomType> Items { get; set; } = default!;
    public TRoomType Item { get; set; } = default!;
    public async Task OnGetAsync()
    {
        Items = await _context.RoomTypes.Where(ii => ii.HotelId == User.GetExtId()).OrderBy(ii => ii.Name).ToListAsync();
    }
}
